home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-03-20 | 5.3 KB | 184 lines | [TEXT/MPS ] |
- # ************************************************************
- #
- # UserStartup•WorkSets.dialog
- # Defines the dialog based workset menu items in the Files menu.
- # Requires MPW Shell 3.4.2b1c3, for the "-e" option to the Windows command.
- #
- # Copyright Apple Computer,Inc. 1996
- # All rights reserved
- #
- # ************************************************************
-
- #
- # A "WorkSet" is a set of related windows which you want to open, close, hide, or
- # show as a group. For example, these can be the windows you need while working on
- # a particular bug fix or new feature.
- # Each "WorkSet" is defined by a file in the new "{MPW}WorkSets:" folder. Each
- # file simply contains a list of the full pathnames of the files in the workset.
- #
- Set Exit 0
-
- #
- # Create the WorkSets folder if it doesn't already exist.
- #
- If (! `Exists -d "{MPW}WorkSets:"`)
- NewFolder "{MPW}WorkSets:"
- End
-
- #
- # Create an initial WorkSet, if one doesn't already exist.
- #
- If ("`Files "{MPW}WorkSets:"`" == "")
- Windows -e > "{MPW}WorkSets:Initial WorkSet" # Don't include the WorkSheet.
- End
-
- #
- # Adding a number to a line in a menu allows you to explicitly reference it.
- # This avoids duplicating the line.
- #
- AddMenu File '(-8' ''
-
- #
- # Add each item in turn.
- #
- # Each menu item gets the current list of workset files, builds a dialog box
- # to allow the user to select the correct item, and then acts on the selected item.
- # "Edit WorkSet..." is special, in that it needs to add and handle the "New..." option.
- # All the extra deltas (∂) are needed for the extra level of evaluation introduced
- # through the AddMenu command.
- #
- AddMenu File "Edit WorkSet..." ∂
- " ∂
- Set CurDir1 ∂`Directory∂`; ∂
- Directory ∂"{MPW}WorkSets:∂"; ∂
- Set Exit 0; ∂
- Set xxxWorkSetList ∂"New... ∂`Files∂`∂"; ∂
- Set xxxAWorkSet ∂"∂`GetListItem ∂{xxxWorkSetList∂} -m 'Select WorkSet:'; Set xStatus ∂{Status∂};∂`∂"; ∂
- If (∂{xStatus∂} == 0); ∂
- If (∂"∂{xxxAWorkSet∂}∂" == ∂"New...∂"); ∂
- Open -n ∂"∂`Request ∂"Name of work set:∂"∂`∂"; ∂
- Windows -e > ∂"∂{Active∂}∂" ; ∂
- Save ∂"∂{Active∂}∂" ; ∂
- Else; ∂
- Open ∂{xxxAWorkSet∂}; ∂
- End; ∂
- End; ∂
- Directory ∂"∂{CurDir1∂}∂"; ∂
- Set Exit 1; ∂
- "
-
- AddMenu File 'Remove WorkSet...' ∂
- " ∂
- Set CurDir1 ∂`Directory∂`; ∂
- Directory ∂"{MPW}WorkSets:∂"; ∂
- Set Exit 0; ∂
- Set xxxWorkSetList ∂"∂`Files∂`∂"; ∂
- If (∂"∂{xxxWorkSetList∂}∂" == ∂"∂"); ∂
- Alert "There are no WorkSets currently defined."; ∂
- Else; ∂
- Set xxxAWorkSet ∂"∂`GetListItem ∂{xxxWorkSetList∂} -m 'Select WorkSet:'; Set xStatus ∂{Status∂};∂`∂"; ∂
- If (∂{xStatus∂} == 0); ∂
- (Close -y ∂"{MPW}WorkSets:∂"∂{xxxAWorkSet∂}) ∑ Dev:Null ; ∂
- (Delete -i ∂"{MPW}WorkSets:∂"∂{xxxAWorkSet∂}) ∑ Dev:Null ; ∂
- End; ∂
- End; ∂
- Directory ∂"∂{CurDir1∂}∂"; ∂
- Set Exit 1; ∂
- "
-
- AddMenu File '(-9' ''
-
- AddMenu File 'Open WorkSet...' ∂
- " ∂
- Set CurDir1 ∂`Directory∂`; ∂
- Directory ∂"{MPW}WorkSets:∂"; ∂
- Set Exit 0; ∂
- Set xxxWorkSetList ∂"∂`Files∂`∂"; ∂
- If (∂"∂{xxxWorkSetList∂}∂" == ∂"∂"); ∂
- Alert "There are no WorkSets currently defined."; ∂
- Else; ∂
- Set xxxAWorkSet ∂"∂`GetListItem ∂{xxxWorkSetList∂} -m 'Select WorkSet:'; Set xStatus ∂{Status∂};∂`∂"; ∂
- If (∂{xStatus∂} == 0); ∂
- Open ∂`Catenate ∂{xxxAWorkSet∂}∂`; ∂
- End; ∂
- End; ∂
- Directory ∂"∂{CurDir1∂}∂"; ∂
- Set Exit 1; ∂
- "
-
- AddMenu File 'Close WorkSet...' ∂
- " ∂
- Set CurDir1 ∂`Directory∂`; ∂
- Directory ∂"{MPW}WorkSets:∂"; ∂
- Set Exit 0; ∂
- Set xxxWorkSetList ∂"∂`Files∂`∂"; ∂
- If (∂"∂{xxxWorkSetList∂}∂" == ∂"∂"); ∂
- Alert "There are no WorkSets currently defined."; ∂
- Else; ∂
- Set xxxAWorkSet ∂"∂`GetListItem ∂{xxxWorkSetList∂} -m 'Select WorkSet:'; Set xStatus ∂{Status∂};∂`∂"; ∂
- If (∂{xStatus∂} == 0); ∂
- Close ∂`Catenate ∂{xxxAWorkSet∂}∂`; ∂
- End; ∂
- End; ∂
- Directory ∂"∂{CurDir1∂}∂"; ∂
- Set Exit 1; ∂
- "
-
- AddMenu File 'Show WorkSet...' ∂
- " ∂
- Set CurDir1 ∂`Directory∂`; ∂
- Directory ∂"{MPW}WorkSets:∂"; ∂
- Set Exit 0; ∂
- Set xxxWorkSetList ∂"∂`Files∂`∂"; ∂
- If (∂"∂{xxxWorkSetList∂}∂" == ∂"∂"); ∂
- Alert "There are no WorkSets currently defined."; ∂
- Else; ∂
- Set xxxAWorkSet ∂"∂`GetListItem ∂{xxxWorkSetList∂} -m 'Select WorkSet:'; Set xStatus ∂{Status∂};∂`∂"; ∂
- If (∂{xStatus∂} == 0); ∂
- ShowWindows ∂`Catenate ∂{xxxAWorkSet∂}∂`; ∂
- End; ∂
- End; ∂
- Directory ∂"∂{CurDir1∂}∂"; ∂
- Set Exit 1; ∂
- "
-
- AddMenu File 'Hide WorkSet...' ∂
- " ∂
- Set CurDir1 ∂`Directory∂`; ∂
- Directory ∂"{MPW}WorkSets:∂"; ∂
- Set Exit 0; ∂
- Set xxxWorkSetList ∂"∂`Files∂`∂"; ∂
- If (∂"∂{xxxWorkSetList∂}∂" == ∂"∂"); ∂
- Alert "There are no WorkSets currently defined."; ∂
- Else; ∂
- Set xxxxxxAWorkSet ∂"∂`GetListItem ∂{xxxWorkSetList∂} -m 'Select WorkSet:'; Set xStatus ∂{Status∂};∂`∂"; ∂
- If (∂{xStatus∂} == 0); ∂
- HideWindows ∂`Catenate ∂{xxxAWorkSet∂}∂`; ∂
- End; ∂
- End; ∂
- Directory ∂"∂{CurDir1∂}∂"; ∂
- Set Exit 1; ∂
- "
-
-
- AddMenu File '(-10' ''
-
- #
- # Now add one more item, just in case you want to unclutter your "File" menu.
- #
- AddMenu File 'Kill WorkSet Dialogs' " ∂
- DeleteMenu File '(-8'; ∂
- DeleteMenu File '(-9'; ∂
- DeleteMenu File '(-10'; ∂
- DeleteMenu File 'Edit WorkSet...' ; ∂
- DeleteMenu File 'Remove WorkSet...' ; ∂
- DeleteMenu File 'Open WorkSet...' ; ∂
- DeleteMenu File 'Close WorkSet...' ; ∂
- DeleteMenu File 'Show WorkSet...' ; ∂
- DeleteMenu File 'Hide WorkSet...' ; ∂
- DeleteMenu File 'Kill WorkSet Dialogs' ; ∂
- "
-
-
- ### Open - File: Error: File name is too long or path is incorrect.
-